<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<div class="entryOperator">
			<div class="entryOperator_Left" onclick="mybudget.router.previous()">
				<div class="opButton">
					&lt; </div>
			</div>
			<div class="entryOperator_Center">
				<div class="entryOperator_Center_Info">
					<div class="entryOperator_Center_Info_Content">
						Date(15/12/2013)
			</div>
				</div>
				<div class="entryOperator_Center_Opt">
					<div class="entryOperator_Center_Opt_item" style="border:none"
						onclick="mybudget.router.filterByPayment()">Payment Filter</div>
					<div class="entryOperator_Center_Opt_item" onclick="mybudget.router.sortByPayment()">Sort Payment</div>
					<div class="entryOperator_Center_Opt_item" onclick="mybudget.router.sortByRecieve()">Sort Recieve</div>
					<div class="entryOperator_Center_Opt_item" onclick="mybudget.router.filterByRecieve()">Recieve
						Filter</div>
				</div>
			</div>
			<div class="entryOperator_Right" onclick="mybudget.router.next()">
				<div class="opButton">
					&gt; </div>
			</div>
		</div>
		<div class="mybudged_entrylist">
			<xsl:for-each select="entries/entry">
				<xsl:sort select="createdDate" order="descending" />
				<div class="mybudget_entry">
					<div class="mybudget_entry_upd">
						<xsl:attribute name="onclick">mybudget.action.UpdateEntry(this);</xsl:attribute>
						<xsl:attribute name="entryId">
					        <xsl:value-of select="id" />
					    </xsl:attribute>
					    <div>U</div>
					</div>
					<div class="mybudget_entry_desc">
						<xsl:value-of select="description" />
					</div>
					<div class="mybudget_entry_detail">
						<div class="mybudget_entry_date">
							<xsl:value-of select="createdDate" />
						</div>
						<xsl:choose>
							<xsl:when test="amount &gt; 0">
								<div class="mybudget_entry_amount_positive">
									<xsl:value-of select="amount" />VND
								</div>
							</xsl:when>
							<xsl:otherwise>
								<div class="mybudget_entry_amount_negative">
									<xsl:value-of select="amount" />VND
								</div>
							</xsl:otherwise>
						</xsl:choose>

					</div>

				</div>
			</xsl:for-each>

		</div>
		<div class="mybudged_entrySummary">
			<div class="mybudget_payment_total">
				<div class="mybudget_total_title">Pay:</div>
			    <div class="mybudget_total_value">
                	<xsl:value-of select="sum(//amount[not(.>=0)])" />VND
			    </div>
			</div>
			<div class="mybudget_recieve_total">
			    <div class="mybudget_total_title">Earn:</div>
			    <div class="mybudget_total_value">
                	<xsl:value-of select="sum(//amount[.>=0])" />VND
			    </div>
			</div>
			<div class="mybudget_remail_total" style="border:none">
			    <div class="mybudget_total_title">Remain:</div>
			    <div class="mybudget_total_value">
                	<xsl:value-of select="sum(//amount)" />VND
			    </div>
			</div>
		</div>
	</xsl:template>
</xsl:stylesheet>